<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>手动开奖</title>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/public/admin/css/H-ui.css" rel="stylesheet" type="text/css" />
<link href="/public/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="/public/admin/font/font-awesome.min.css"/>

<script type="text/javascript" src="/public/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/admin/layer/layer.min.js"></script>
</head>
<body>
<nav class="Hui-breadcrumb"> <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="icon-refresh"></i></a></nav>
<div class="setnav">
    <span>当前信息</span>
     <span> </span>
     <span> </span>
     <span> </span>   
     <span> </span>   
</div>
<h4>本期下注情况</h4>
<div class="qingkuang" style="width: 85%;margin: 10px auto 0;">
       <ul>
           
       </ul>
 </div>
    <div class="sdkaijiang">
        <div class="conte">
            <span class="btn btn-success radius" onclick="Lalert(600,400,'关闭自动开奖','/?G=admin/shutOpen');">关闭开奖</span>
            <span><input id='qh' type="text" style="width: 100px;" value="" placeholder="开奖期号" /></span>
            <span><input id='jg' type="text"  style="width: 400px;" value="" placeholder="开奖结果：04,05,03,09,02,08,10,07,01,06" /></span>
            <span><input id='time' type="text" style="width: 150px;" value="" placeholder="开奖时间:2017-1-1 9:07" /></span>
            <span>
                <select id="game">
                    <option value="1">赛车</option>
                    <option value="2">飞艇</option>
                </select>
            </span>
          <!--   <span class="btn btn-success radius">计算</span> -->
            <span id="kaijiang" class="btn btn-success radius">手动开奖</span>
         <!--    <div class="jg">龙虎：龙  龙 龙 龙 龙      &nbsp;&nbsp;&nbsp;&nbsp; 9,小,双,闲,B</div> -->
        </div>
    </div>
    
 <style>
    body{background-color:#ccc;}
    .setnav{width:95%;margin: 30px auto;height: 30px;}
    .setnav span{margin-top: 20px;margin-left: 30px;}
    h4{padding-left: 60px;}
    .qingkuang ul{ width: 100%;height: auto;}
    .qingkuang li{width:20%;float: left;height: 30px;line-height: 30px;}
    .sdkaijiang{width: 100%;margin: 0 auto;position:fixed;bottom: 0px;height: 50px;background-color: white;}
    .conte{width: 90%;margin: 15px auto; height: 70px;}
    .sdkaijiang span input{height:30px;padding-left:10px; }
    .sdkaijiang span {margin-left: 10px;}
    .jg{text-align: center;height: 25px;line-height: 25px;}
 </style>
</body>
</html>
<script type="text/javascript" src="/public/admin/js/self.js"></script>

<script>
	$(function(){
		$("#kaijiang").click(function(){
				var qh=$("#qh").val();
				var jg=$("#jg").val();
				var time=$("#time").val();
				var game=$("#game").val();
			if(!qh || !jg ||  !time || !game){
				 Malert('请填写所有信息，在开奖');
				 return;
			}
			
			alert('开始请求！');	
			$.ajax({
		         type: "POST",
		         url: "/index.php?G=admin/handOpen",
		         data:{'qh':qh,'jg':jg,'time':time,'game':game},
		         success:function(data){
			         Malert(data);
		         }
			});
		});
		setInterval(function(){

			$.ajax({
		         type: "POST",
		         url: "/index.php?G=admin/setUserData",
		         data:{},
		         success:function(data){
		        	var obj= eval("("+data+")");
		        	
		        	$(".setnav").find('span').eq(1).html('');
		        	$(".setnav").find('span').eq(1).html("期号："+obj['qh']['issue']);

		        	$(".setnav").find('span').eq(4).html('');
		        	$(".setnav").find('span').eq(4).html("开奖时间："+obj['qh']['oktime']);
		        	
		        	if(obj['qh']['tagf']==1){
		        		$(".setnav").find('span').eq(2).html(''); 
		        		$(".setnav").find('span').eq(2).html("封盘：是");
		        	}else{
		        		$(".setnav").find('span').eq(2).html(''); 
		        		$(".setnav").find('span').eq(2).html("封盘：否");
		        	}
		        	
		        	if(obj['qh']['fp30']==1){
		        		$(".setnav").find('span').eq(3).html(''); 
		        		$(".setnav").find('span').eq(3).html("30秒：是");
		        	}else{
		        		$(".setnav").find('span').eq(3).html(''); 
		        		$(".setnav").find('span').eq(3).html("30秒：否");
		        	}

		        	delete obj['qh'];
					$(".qingkuang ul").html("");
					$.each(obj,function(i,o){
						if(o['stype']=='和'){
							$(".qingkuang ul").append("<li>冠亚"+o['stype']+'-'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if(o['stype']=='和'){
							$(".qingkuang ul").append("<li>冠亚"+o['stype']+'-'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if((o['stype']=='双' || o['stype']=='大' || o['stype']=='小' || o['stype']=='单') && !isNaN(o['nums'])){
							$(".qingkuang ul").append("<li>名次:"+o['nums']+'-'+o['stype']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if(!isNaN(o['stype']) && !isNaN(o['nums'])){
							$(".qingkuang ul").append("<li>名次:"+o['stype']+'-车道：'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if((o['stype']=='大双' || o['stype']=='大单' || o['stype']=='小双' || o['stype']=='小单') && !isNaN(o['nums'])){
							$(".qingkuang ul").append("<li>名次:"+o['nums']+'-'+o['stype']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if((o['stype']=='龙' || o['stype']=='虎') && !isNaN(o['nums'])){
							$(".qingkuang ul").append("<li>"+o['stype']+'-'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if(o['stype']=='庄闲'){
							$(".qingkuang ul").append("<li>"+o['stype']+'-'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if(o['stype']=='组'){
							$(".qingkuang ul").append("<li>"+o['stype']+' &nbsp;&nbsp;'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}else if(o['stype']=='ABC'){
							$(".qingkuang ul").append("<li>"+o['stype']+' &nbsp;&nbsp;'+o['nums']+'&nbsp;&nbsp;￥'+o['money']+"</li>");
						}
						
						
						
					});
		        	
		        	//console.log(obj);
			         //Malert(data);
		         }
			 });

		},1000);
			 
	});

</script>